package codes

type Code uint32

const (
	OK      Code = 0
	Unknown Code = 1

	BadRequest       Code = 400 // RFC 7231, 6.5.1
	Unauthorized     Code = 401 // RFC 7235, 3.1 // 未登录
	Forbidden        Code = 403 // RFC 7231, 6.5.3 // 无权限
	NotFound         Code = 404 // RFC 7231, 6.5.4
	MethodNotAllowed Code = 405 // RFC 7231, 6.5.5
	RequestTimeout   Code = 408 // RFC 7231, 6.5.7
	Conflict         Code = 409 // RFC 7231, 6.5.8

	InternalServerError Code = 500 // RFC 7231, 6.6.1
)

const (
	// 账户错误码 100前缀
	UnknownAccount             Code = 100401
	InvalidPassword            Code = 100402
	InvalidVerifyCode          Code = 100403
	AccountExist               Code = 100404
	InvalidTicket              Code = 100405
	InvalidIdToken             Code = 100406
	InvalidEmail               Code = 100407
	ThirdAccountExist          Code = 100408
	AccountBoundThird          Code = 100409
	InvalidPhone               Code = 100410
	InvalidChannel             Code = 100411
	DataHasBeenRefreshed       Code = 100412
	PasswordNotConfirm         Code = 100413
	UnknownAccountPhone        Code = 100414
	PhoneHasBeenUsed           Code = 100415
	EmailHasBeenUsed           Code = 100416
	TipForBindPhoneOrEmail     Code = 100417
	UserNotFound               Code = 100418
	TheInvitationCodeIsInvalid Code = 100419
	UserNotVip                 Code = 100420
	UserVipEexpired            Code = 100421
	InvalidParams              Code = 100422
	UserScoreNotEnough         Code = 100423
	UserBalanceNotEnough       Code = 100424

	// 通知 101前缀
	NotificationNotFound Code = 101001

	// 成员事件 102前缀
	MemberEventNotFound        Code = 102001
	EventTypeNotFound          Code = 102002
	SystemEventTypeNotOperate  Code = 102003
	ImagesMaxLimitTo9          Code = 102004
	MemberEventIsExist         Code = 102005
	MemberBirthdayAfterDiedday Code = 102006
	CashAccountNotFound        Code = 102007
	ApplyTransferMinAmount     Code = 102008

	AlreadyExists Code = 300001

	// 业务错误码 400前缀

	// weixinmini 800前缀
	WeixinMiniCodeInvalid Code = 800001
	WeixinPayNotFound     Code = 800002

	// 成员关系 900前缀
	MemberUniqueRelationshipAlreadyExists Code = 900001
	MemberNotFound                        Code = 900002
	MemberChildrenExist                   Code = 900003
	MemberImagesNotFound                  Code = 900004

	// 兑换码 1000前缀
	ExchangeCodeNotFound Code = 1000001
	ExchangeCodeUsed     Code = 1000002
	ExchangeCodeExpired  Code = 1000003
)
